package generators;

import gamebackend.Block;

import java.util.Scanner;

public class PatternGenerator extends AbstractGenerator {
	private static final char FILLED = '0';
	private final String my_pattern;
	private int index;

	public PatternGenerator(Block the_block, String the_pattern) {
		super(the_block);
		my_pattern = the_pattern;
		index = my_pattern.length() - 1;
	}

	@Override
	public void generate(Block[][] blocks) {
		if (index < 0) {
			return;
		}
		int row = blocks.length - 1;
		for (int col = 0; col < blocks[row].length; col++) {
			if (my_pattern.charAt(index) == FILLED) {
				blocks[row][col] = getBlock();
			}
			index--;
		}
		
		
		
	}
	
	

}
